import requests
import re


def spider(url):
    response = requests.get(url)
    html = response.text
    obj = re.compile(r'"objURL":"(.*?)"')
    img_infos = obj.findall(html)
    print(len(img_infos))


if __name__ == '__main__':
    url = 'http://image.baidu.com/search/index?tn=baiduimage&ps=1&ct=201326592&lm=-1&cl=2&nc=1&ie=utf-8&word='
    data = '皮卡丘'
    url = url + data
    spider(url)
